import type { App } from 'vue';
import * as svg from '@element-plus/icons-vue';
import SvgIcon from '../components/svgIcon/src/index.vue';


// 把驼峰转换成横杠链接
export const toLine = (value:string) =>{
    return value.replace(/(A-Z)g/,'-$1').toLocaleLowerCase()
}

/**
 * 导出全局注册 element plus svg 图标
 * @param app vue 实例
 * @description 使用：https://element-plus.gitee.io/zh-CN/component/icon.html
 */
 export function elSvg(app: App) {
	const icons = svg as any;
	for (const i in icons) {
		app.component(`ele-${icons[i].name}`, icons[i]);
	}
	app.component('SvgIcon', SvgIcon);
}